home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Gold Medal Software 3
/
Gold Medal Software - Volume 3 (Gold Medal) (1994).iso
/
utils2
/
qfrmt13.arj
/
2M-TECH.DOC
< prev
next >
Wrap
Text File
|
1994-02-02
|
7KB
|
135 lines
TECHNICAL INFORMATION FOR PROGRAMERS
------------------------------------
Perhaps you need know how to format 2M diskettes from your high-level
applications. 2M access always directly to NEC765 diskette controller chip
and 8237 DMA controller. But you have'nt to do the same!!.
When 2M is installed on memory, INT 13h service 5 becomes increased
its functionality. To find 2M resident on memory:
Load AL with 0.
Load ES:DI with 1492h:1992h.
Load AH with a value from 0C0h to 0FFh.
Call INT 2Fh.
When INT 2Fh returns, if AL=0FFh and ES:DI points a "CiriSOFT:2M:1.3"
null terminated string... 2M is in memory!. Note that ':' is a delimiter
and not always CiriSOFT will be the manufacturer (I recomend search only
for the ":2M:" string). You can begin scanning with AH=0C0h and, if not
found 2M there, continue with AH=0C1h and so on.
When you had detected 2M on memory, you can call to INT 13h function
5 to format a diskette track. This is easiest than standard BIOS service:
you don't need to select disk density or media. Of course, standard BIOS
function is still available, but if you can call INT 13h as bellow:
Load AH with 5.
Load AL with 7Fh.
Load CH with track number.
Load DH with head number.
Load DL with drive number.
Load SI with 324Dh signature ("2M").
Load ES:BX pointing to boot sector of future 2M diskette.
Note that in standard BIOS call, AL sets the number of sectors (never
is 7Fh) and SI is not neccesary equal to 324Dh. This lets 2M to detect your
intention. You have not to fill big tables on ES:BX, simply point to a boot
sector of future diskette. This boot sector can be obtained from standard
2M diskette already formatted. New INT 13h format function return the sames
codes in AH than the BIOS standard routines.
You don't need to build your own boot sectors, buf if you decide to
modify something, you must know:
- 2M diskettes have always TWO FAT copies, for hardware reasons. Do
not try to alter this specification (yes, for *hardware* reasons).
- Modifing system ID probably makes 2M not able to detect the diskette,
and standard BIOS will report sector-not-found errors.
- Yoy can modify the jump instruction at the begin of boot, and the
boot code located after destination of this jump. But data located
from offset 63 to last byte before boot code is covered by checksum,
and you have to compute it if you modify something (the arithmetic 8
bits add off all bytes must be zero, use checksum byte to force it).
- Resuming: you can only modify offsets from 0 to 2, from 11 to 61 (it
is not recommended) and the boot code.
- If you try to write a boot sector modifing system ID, or with an
incorrect checksum, 2M resident code will not really write the
sector on target disk and you will lose your time and your patience.
If you uninstall 2M to save a boot with bad checksum, the sector
will be saved, but... with 2M installed you'll get 'seek error' on
future access.
Here are the format of 2M diskettes, in order to meet your curiosity;
2M is not a secret or magic program!. See source code for more information
(if you don't understand the source code comments, you may come to Spain
next summer :) ).
* BOOT SECTOR OF 2M DISKETTE (COMMON TO ALL FORMATS).
Assembler Comment Offset
--------------------- ---------------------------------- ----------
JMP SHORT BootP ; 2 bytes 0
NOP ; 1 byte 2
DB "2M-STV04" ; system ID 3
DW 512 ; bytes per sector 11
DB 1 ; sectors per cluster 13
DW 1 ; sectors reserved at beginning 14
DB 2 ; number of FAT copies 16
DW 224 ; root directory entries 17
DW 3772 ; total sectors on disk 19
DB 0F0h ; media descriptor 21
DW 11 ; sectors ocupied by each FAT 22
DW 23 ; sectors per track 24
DW 2 ; number of heads 26
DD 0 ; special sectors reserved 28
DD 0 ; number of sectors (32 bit drives) 32
DB 0 ; physical drive 36
DB 0 ; reserved 37
DB 29h ; DOS > 4.0 diskette 38
DD 4B368A0Eh ; serial number (random) 39
DB "NO NAME " ; disk label 43
DB "FAT12 " ; FAT type 54
DB 0 ; reserved by 2M 62
DB 0 ; 2M checksum (if used) 63
DB 6 ; 2MF format version 64
DB 1 ; 1 if write track after format 65
DB 0 ; data transfer rate on track 0 66
DB 0 ; data transfer rate on track<>0 67
DW BootP ; offset to boot program 68
DW Infp0 ; T1: information for track 0 70
DW InfpX ; T2: information for track<>0 72
DW InfTm ; T3: tracks sectors size table 74
* NORMAL FORMATS (820/1476/984/1804K). FOR EXAMPLE: 1804K.
Infp0 DB 18, 108 ; number of sectors / GAP 3 for format
DB 1,2,3,4,5,6,7,8 ; sectors ordered (19..20 does not exist)
DB 9,10,11,12,13
DB 14,15,16,17,18
InfpX DB 11, 40 ; number of sectors / GAP3 for format
DB 3 ; sector size
DB 1, 2 ; sector slidding (override by 2MF /X /Y)
InfTm DB 3,3,3,3,3,3 ; size of sectors 1, 2, 3,...
DB 3,3,3,3,3
BootP:... ; boot program
* MAXIMUM CAPACITY FORMATS (902/1558/1066/1886K). FOR EXAMPLE: 1886K.
Infp0 DB 18, 108 ; number of sectors, GAP3 for format
DB 1,2,3,4,5,6,7,8 ; sectors ordered (19..23 does not exist)
DB 9,10,11,12,13
DB 14,15,16,17,18
InfpX DB 64, 3 ; number of sectors / GAP3 for preformat
DB 7 ; number of sectors to renum
DB 128+1, 4, 4 ; renum table:
DB 128+12, 1, 4 ; number of sector, new number, size
DB 128+23, 5, 4
DB 128+34, 2, 4
DB 128+45, 6, 3
DB 128+51, 3, 4
DB 128+62, 7, 2
InfTm DB 4,4,4,4,4,3,2 ; size of sectors 1, 2, 3,...
BootP:... ; boot program